﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备
/// </summary>
[Index("tpi_complete", Name = "idxcomplete")]
[Index("tpi_id", Name = "idxid", IsUnique = true)]
[Index("tpi_key", Name = "idxkey")]
[Index("tpi_taskobj_guid", Name = "idxlcuguid")]
[Index("tpi_guid", Name = "idxlguid")]
[Index("tpi_status", Name = "idxstatus")]
[Index("tpi_tp_guid", Name = "idxtpguid")]
[Index("tpi_type", Name = "idxtype")]
public partial class iot_device_task_plain_item_handle
{
    [Key]
    public long tpi_id { get; set; }

    [StringLength(50)]
    public string tpi_guid { get; set; }

    /// <summary>
    /// 条件iot_device_task_plain
    /// </summary>
    [StringLength(100)]
    public string tpi_tp_guid { get; set; }

    /// <summary>
    /// 设备ID
    /// </summary>
    [StringLength(50)]
    public string tpi_taskobj_guid { get; set; }

    /// <summary>
    /// 0指令，1条件,100延时,2条件成立，否则执行条件tpi_object_guid,3设备主动上传数据
    /// </summary>
    public int? tpi_type { get; set; }

    /// <summary>
    /// 指令key iot_device_variable
    /// </summary>
    [StringLength(50)]
    public string tpi_key { get; set; }

    /// <summary>
    /// 值
    /// </summary>
    [StringLength(255)]
    public string tpi_value { get; set; }

    /// <summary>
    /// 值&gt;  =或&lt;
    /// </summary>
    [StringLength(255)]
    public string tpi_value_rlue { get; set; }

    /// <summary>
    /// 顺序
    /// </summary>
    public int? tpi_order { get; set; }

    /// <summary>
    /// 执行次数，不会等待 -1无限次，-100停止
    /// </summary>
    public int? tpi_repeat_count { get; set; }

    /// <summary>
    /// 每隔秒执行一次
    /// </summary>
    public float? tpi_repeat_interval { get; set; }

    /// <summary>
    /// 0正常，1无效
    /// </summary>
    public int tpi_status { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    [StringLength(50)]
    public string tpi_title { get; set; }

    /// <summary>
    /// 运行批次号
    /// </summary>
    [StringLength(50)]
    public string tpi_execute_batch_no { get; set; }

    /// <summary>
    /// 延时触发时间
    /// </summary>
    [Column(TypeName = "datetime(3)")]
    public DateTime? tpi_execute_delayed_time { get; set; }

    /// <summary>
    /// 0未完成，1已完成
    /// </summary>
    public int? tpi_complete { get; set; }

    /// <summary>
    /// 运行时间
    /// </summary>
    [Column(TypeName = "datetime(3)")]
    public DateTime? tpi_execute_time { get; set; }

    [Column(TypeName = "datetime(3)")]
    public DateTime? tpi_add_time { get; set; }
}
